//
//  GameViewController.swift
//  aircraftBattle1
//
//  Created by 许洋 on 2024/5/15.
//

import UIKit
import SpriteKit
import GameplayKit

class GameViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        if let view = self.view as! SKView? {
            // Load the SKScene from 'BattleScene.sks'
            if let scene = HomeScene(fileNamed: "HomeScene") {
                scene.size = CGSize(width: 1242, height: 2668)
                scene.scaleMode = .aspectFill
                scene.viewController = self
                view.presentScene(scene)
            }
            
            view.ignoresSiblingOrder = true
            view.showsFPS = true
            view.showsNodeCount = true
        }
    }

    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        if UIDevice.current.userInterfaceIdiom == .phone {
            return .allButUpsideDown
        } else {
            return .all
        }
    }

    override var prefersStatusBarHidden: Bool {
        return true
    }
}
